﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using QLTV_Public;

namespace QLTV_Data
{
   public class NhatKy_Data
    {
       KetNoiCSDL_Data kn = new KetNoiCSDL_Data();
       public DataTable LayDuLieu()
       {
           return kn.LayDuLieu("Load_tbl_NhatKy");
       }
       public DataTable taoBang(string sql)
       {
           return kn.taobang(sql);
       }
       public int Delete_NhatKy_All()
       {
           return kn.update("Delete_NhatKy_All");
       }
       public int insert_NhatKy(NhatKy_Public maNV, NhatKy_Public ngayGio, NhatKy_Public hanhDong, NhatKy_Public moTa)
       {
           int n = 4;
           string[] name = new string[n];
           object[] value = new object[n];
           name[0] = "@MaNV";
           value[0] = maNV.MaNV;
           name[1] = "@NgayGio";
           value[1] = ngayGio.NgayGio;
           name[2] = "@HanhDong";
           value[2] = hanhDong.HanhDong;
           name[3] = "@MoTa";
           value[3] = moTa.MoTa;
           return kn.update("insert_NhatKy",name,value,n);
       }
       public int delete_NhatKy(NhatKy_Public maNhatKy)
       {
           int n = 1;
           string[] name = new string[n];
           object[] value = new object[n];
           name[0] = "@MaNhatKy";
           value[0] = maNhatKy.MaNhatKy;
           return kn.update("delete_NhatKy", name, value, n);
       }

    }
}
